import { Router, Route, Switch } from 'react-router-dom'
import Login from './pages/Login/index'
import Layout from './pages/Layout/index'
import NotFound from './pages/NotFound/index'

import AuthRoute from './components/AuthRouter'
// 跳转方式
import { createBrowserHistory } from 'history'
export const history = createBrowserHistory()
function App () {
  return (
    <div className="app">
      <Router history={history}>
        <Switch>
          {/* 默认显示页面 / {Login} */}
          <Route path="/login" component={Login} />
          <AuthRoute path="/home" component={Layout} />
          {/* 增加一个404页面 */}
          <Route component={NotFound} />
        </Switch>
      </Router>
    </div>
  )
}

export default App
